<template>
  <div class="home">
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="blue" height='600' @change='change' ref="checkbox">
      <van-swipe-item><img src="../assets/img/1.png" alt=""></van-swipe-item>
      <van-swipe-item><img src="../assets/img/2.png" alt=""></van-swipe-item>
      <van-swipe-item><img src="../assets/img/3.png" alt=""></van-swipe-item>
      <van-swipe-item><img src="../assets/img/4.png" alt=""></van-swipe-item>
    </van-swipe>
    <div class="tiao" @click="go">跳过</div>
  </div>
</template>

<script>
// @ is an alias to /src

export default {
  name: "Home",
  data(){
    return{
      i:10
    }
  },
  components: {},
  methods: {
    change(index){

      console.log(index);
      if(index===0&&this.i===3){
        this.$router.push('/login')
      }
      this.i=index
    },
    go(){
      this.$router.push('/login')
    }
  },
};
</script>
<style scoped>
.home{
  background-color: #fff;
  height: 100%;
}
  .my-swipe .van-swipe-item {
    color: #fff;
    font-size: 20px;
    line-height: 150px;
    text-align: center;
    /* background-color: #39ed57; */
  }
  img{
    width: 100%;
    margin-top: 0.6rem;
  }
  .tiao{
    /* display: block; */
    width: 1rem;
    height: 0.6rem;
    background-color: #eee;
    border-radius: 20%;
    text-align: center;
    line-height: 0.6rem;
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
  }

</style>